jQuery(document).ready(function() {
	
	//Jcarousel
	$('.jcarousel').jcarousel();
	$('.jcarousel-control-prev')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '-=1'
	});

	$('.jcarousel-control-next')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '+=1'
	});
	//Jcarousel
	
	//Jcarousel-Produtos
	$('.jcarousel-produtos').jcarousel();
	$('.jcarousel-produtos-control-prev')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '-=5'
	});

	$('.jcarousel-produtos-control-next')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '+=5'
	});
	//Jcarousel-Produtos
	
	//Jcarousel-Diversao
	$('.wrapper-slide-diversao').jcarousel();
	$('.wrapper-slide-diversao-control-prev')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '-=1'
	});

	$('.wrapper-slide-diversao-control-next')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '+=1'
	});
	//Jcarousel-Diversao
	
	//Jcarousel-videos
	$('.slide-videos-vertical').jcarousel({
			vertical: true
		});
	$('.slide-videos-vertical-control-prev')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '-=5'
	});

	$('.slide-videos-vertical-control-next')
		.on('jcarouselcontrol:active', function() {
			$(this).removeClass('inactive');
		})
		.on('jcarouselcontrol:inactive', function() {
			$(this).addClass('inactive');
		})
		.jcarouselControl({
			target: '+=5'
	});
	//Jcarousel-videos
	
	//Jcarousel-Blog
	$('.wrapper-slideshow-blog').jcarousel();
	$('.wrapper-slideshow-blog-control-prev')
            .on('jcarouselcontrol:active', function() {
                $(this).removeClass('inactive');
            })
            .on('jcarouselcontrol:inactive', function() {
                $(this).addClass('inactive');
            })
            .jcarouselControl({
                target: '-=1'
            });

        $('.wrapper-slideshow-blog-control-next')
            .on('jcarouselcontrol:active', function() {
                $(this).removeClass('inactive');
            })
            .on('jcarouselcontrol:inactive', function() {
                $(this).addClass('inactive');
            })
            .jcarouselControl({
                target: '+=1'
            });
	$('.wrapper-slideshow-blog-pagination')
            .on('jcarouselpagination:active', 'a', function() {
                $(this).addClass('active');
            })
            .on('jcarouselpagination:inactive', 'a', function() {
                $(this).removeClass('active');
            })
            .jcarouselPagination();
	//Jcarousel-Blog
	
	$('a[href^="#"]').on('click',function (e) {
	    e.preventDefault();

	    var target = this.hash,
	    $target = $(target);

	    $('html, body').stop().animate({
	        'scrollTop': $target.offset().top
	    }, 900, 'swing', function () {
	        window.location.hash = target;
	    });
	});
	
	
	jQuery('.nav-menu>li').hover(
		function(){
			jQuery(this).find('.sub-menu').show();
		},
		function(){
			jQuery('.nav-menu>li>.sub-menu').hide();
		});	
	
	jQuery('.sub-menu>li>a').hover(function(){
		jQuery(this).parent().parent().parent().addClass('current-menu-item');
		}, function(){
		jQuery(this).parent().parent().parent().removeClass('current-menu-item');
	});

	 $('a[href="#signin"]').fancybox({
        helpers: {
            overlay: {
                opacity: 0.98,
                css: { 'background-color': '#fff' }
            }
        }
	});

	 $('a[href="#popin-produtos"]').fancybox({
        helpers: {
            overlay: {
                opacity: 0.98,
                css: { 'background-color': '#000' }
            }
        }
	});
	
	$("#birth").mask("99/99/9999");
	$(".birth2").mask("99/99/9999");

	
	jQuery('span.close').click(function(){
		jQuery('div.error').hide();
		jQuery('div.alert').hide();
	});
	
	try {
		jQuery('.turminha-lista li#m1 a img').click(function(){jQuery('.turminha-lista li#m1').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#m1').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#m2 a img').click(function(){jQuery('.turminha-lista li#m2').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#m2').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#m3 a img').click(function(){jQuery('.turminha-lista li#m3').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#m3').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#m4 a img').click(function(){jQuery('.turminha-lista li#m4').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#m4').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#m5 a img').click(function(){jQuery('.turminha-lista li#m5').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#m5').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#m6 a img').click(function(){jQuery('.turminha-lista li#m6').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#m6').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#m7 a img').click(function(){jQuery('.turminha-lista li#m7').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#m7').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#mdog a img').click(function(){jQuery('.turminha-lista li#mdog').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#mdog').find('.txt-turminha').css('display', 'block')});
		jQuery('.turminha-lista li#mcat a img').click(function(){jQuery('.turminha-lista li#mcat').css("z-index","9999999999999999"); jQuery('.gray-overlay').css("display","block"); jQuery('.turminha-lista li#mcat').find('.txt-turminha').css('display', 'block')});
	} catch(err){}
	
	try {
		jQuery('.turminha-lista li#m1 span.close-turminha').click(function(){jQuery('.turminha-lista li#m1').css('z-index', '1');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#m2 span.close-turminha').click(function(){jQuery('.turminha-lista li#m2').css('z-index', '2');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#m3 span.close-turminha').click(function(){jQuery('.turminha-lista li#m3').css('z-index', '3');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#m4 span.close-turminha').click(function(){jQuery('.turminha-lista li#m4').css('z-index', '4');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#m5 span.close-turminha').click(function(){jQuery('.turminha-lista li#m5').css('z-index', '3');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#m6 span.close-turminha').click(function(){jQuery('.turminha-lista li#m6').css('z-index', '2');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#m7 span.close-turminha').click(function(){jQuery('.turminha-lista li#m7').css('z-index', '1');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#mdog span.close-turminha').click(function(){jQuery('.turminha-lista li#mdog').css('z-index', '5');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
		jQuery('.turminha-lista li#mcat span.close-turminha').click(function(){jQuery('.turminha-lista li#mcat').css('z-index', '5');  jQuery('.gray-overlay').css("display","none");  jQuery('.txt-turminha').css('display', 'none');});
	} catch(err){}
});

